﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using CoolEngine.Engine;

namespace CoolEngine.Gui
{
    public class GameScreen:GuiControl
    {
        public bool FullScreen { get; set; }

        public GameScreen(CoolGame game, GuiRenderer renderer):base(game, renderer)
        {

        }

        public GameScreen(CoolGame game, GuiRenderer renderer, GuiControl parent)
            : base(game, renderer, parent)
        {

        }
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }
        public bool AlwaysUpdate { get; set; }
        protected override void OnVisibleChanged(object guiComponent, EventArgs eventArgs)
        {
            if (Visible)
            {
                if (GameManager.GameState.CurrentScreen != this)
                {
                    GameManager.GameState.Screens.Push(this);
                }
            }
            else
            {
                if (GameManager.GameState.CurrentScreen == this)
                {
                    GameManager.GameState.Screens.Pop();
                }
            }
            base.OnVisibleChanged(guiComponent, eventArgs);
        }
        public override void Initialize()
        {
            //Visible = true;
            Enabled = true;
            DrawLocation = new Rectangle(0, 0, Game.Graphics.PreferredBackBufferWidth, Game.Graphics.PreferredBackBufferHeight);
            FullScreen = true;
            base.Initialize();
        }
    }
}
